<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>Document</title>
  <script>
    window.onload=function(){
        var mydiv = document.getElementById("mydiv");
        alert("页面加载完成,mydiv的内容是:"+mydiv.innerText);
    }
  </script>
 </head>
 <body>
  <div id='mydiv'>我有一个好主意</div>
 </body>
</html>
